<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
        .table1{
            border:1px solid #ddd;
            width:900px;
            
        }
        thead{
            background-color:lightblue;
        }

    </style>
</head>
<body>
    <table border="0" width="900px">
        <tr>
            <td align="center" style="font-size:24px; color:#999">部门管理</td>
        </tr>
        <tr>
            <td align="right" > <a href="${pageContext.request.contextPath}/department/add">添加</a></td>
        </tr>
     </table>

     <br/>

    <table cellspacing="0" border="1" class="table1">
        <thead>
            <tr>
	            <th width="450">部门名称</th>
	            <th  width="450">编辑</th>
	            <th  width="450">删除</th>
            </tr>
        </thead>
        <tbody>
        <c:forEach var="sk" items="${pageBean.list}">
            <tr>
                <td align="center">${sk.dname}</td>
                <td align="center">${sk.ddesc}</td>
                <td align="center">
                    <a href="${pageContext.request.contextPath}/department/edit/${sk.did}"><img src="${pageContext.request.contextPath}/images/edit.png" /></a>
                    <a href="${pageContext.request.contextPath}/department/delete/${sk.did}"><img src="${pageContext.request.contextPath}/images/nolines_minus.gif" /></a>
                </td>
            </tr>
         </c:forEach>
         </tbody>
    </table>
   
    <br/>

    <table border="0" cellspacing="0" cellpadding="0"  width="900px">
        <tr>
            <td align="right">
                <span>第${pageBean.currPage}/${pageBean.totalPage}页</span>
                <span>总记录数：${pageBean.totalCount}每页显示:${pageBean.pageSize}</span>
                <span>
                <c:if test="${pageBean.currPage != 1}">
                    <a href="${pageContext.request.contextPath}/department/list?currentPage=1">[首页]</a>&nbsp;&nbsp;
                    <a href="${pageContext.request.contextPath}/department/list?currentPage=${pageBean.currPage - 1}">[上一页]</a>&nbsp;&nbsp;
                </c:if>
                <c:if test="${pageBean.currPage != pageBean.totalPage}">
                    <a href="${pageContext.request.contextPath}/department/list?currentPage=${pageBean.currPage + 1}">[下一页]</a>&nbsp;&nbsp;
                    <a href="${pageContext.request.contextPath}/department/list?currentPage=${pageBean.totalPage}">[尾页]</a>&nbsp;&nbsp;
                </c:if>
                </span>
            </td>
        </tr>
     </table>
</body>
</html>